﻿using System.Web.Mvc;
using System.Web.Routing;
using VideoSeller.Core.Web.Routes;

namespace VideoSeller.Web.App_Start
{
	public class RouteConfig
	{
		public static void RegisterRoutes(RouteCollection routes)
		{
			routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
			routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
			routes.Ignore("*/Upload/OnlineContent/*");
            routes.Ignore("*/Content/images/*");
            routes.Ignore("*/history_live/*");

			routes.Add(new LowercaseRoute("content/nocontent",
			                              new RouteValueDictionary(new {controller = "Content", action = "NoContent"}),
			                              new MvcRouteHandler()));
			routes.Add(new LowercaseRoute("content/{id}",
										  new RouteValueDictionary(new { controller = "Content", action = "Index" }),
			                              new MvcRouteHandler()));
			routes.Add(new LowercaseRoute("{controller}/{action}/{email}/{guid}",
			                              new RouteValueDictionary(new {controller = "Home", action = "Activate"}),
			                              new MvcRouteHandler()));
			routes.Add(new LowercaseRoute("{controller}/{action}/{id}",
										  new RouteValueDictionary(new { controller = "Home", action = "Online", id = UrlParameter.Optional }),
										  new MvcRouteHandler()));
		}
	}
}